package com.aaa.tars.controller;

import com.aaa.tars.entity.Role;
import com.aaa.tars.entity.ScenicAudit;
import com.aaa.tars.service.ScenicAuditService;
import com.aaa.tars.util.Page;
import com.aaa.tars.util.Result;
import com.aaa.tars.util.ResultUtil;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @FileName: ScenicAuditController
 * @Description:
 * @Author: xm
 * @CreateTime: 2025/9/24 15:44
 * @Version: 1.0.0
 */
@RestController
@RequestMapping("/scenicAudit")
public class ScenicAuditController {
    @Resource
    private ScenicAuditService scenicAuditService;

    @PostMapping("queryByPage")
    public Result queryByPage(@RequestBody Page<ScenicAudit> page) {
        return ResultUtil.success(scenicAuditService.queryByPage(page));
    }

    @GetMapping("queryById")
    public Result queryById(Integer auditId) {
        return ResultUtil.success(scenicAuditService.queryById(auditId));
    }

    @PostMapping("add")
    public Result add(@RequestBody ScenicAudit scenicAudit) {
        return ResultUtil.success(scenicAuditService.insert(scenicAudit));
    }

    @PostMapping("update")
    public Result update(@RequestBody ScenicAudit scenicAudit) {
        return ResultUtil.success(scenicAuditService.update(scenicAudit));
    }

    @DeleteMapping("deleteById")
    public Result deleteById(Integer auditId) {
        return ResultUtil.success(scenicAuditService.deleteById(auditId));
    }

}
